package besuper;

import java.util.Random;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;

@XmlAccessorType(XmlAccessType.FIELD)
public class Player {
	
	private static int numOfPlayers = new Random().nextInt(10) + 10;

	public Player() {
		id = ++numOfPlayers;
	}

	public Player(String name) {
		this.id = ++numOfPlayers;
		this.name = name;
	}

	public Player(String name, int id) {
		this.name = name;
		this.id = id;
	}

	@XmlElement(name = "score")
	private int score;

	@XmlAttribute(name = "id")
	private int id;

	@XmlElement(name = "name")
	private String name;

	public int getId() {
		return id;
	}

	public int getScore() {
		return score;
	}

	public void addScore(int score) {
		this.score += score;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
